export interface User {
  id: string;
  username: string;
  email: string;
  role: string;
  phone?: string;
  token?: string;
}

export interface LoginParams {
  username: string;
  password: string;
}

export interface RegisterParams extends LoginParams {
  email: string;
  phone?: string;
}

export interface LoginResponse {
  token: string;
  username: string;
  role: string;
  lastLogin: string;
}

export interface UserState {
  user: User | null;
  token: string | null;
  isAuthenticated: boolean;
}

export interface ChangePasswordParams {
  oldPassword: string;
  newPassword: string;
}

export interface ChangeEmailParams {
  email: string;
}

// 接口响应数据类型定义
export interface UserInfo {
  userId: string;
  username: string;
  email: string;
  role: string;
  lastLogin: string;
  createTime: string;
}